FROM hub.erisedmedia.com/adoptopenjdk/openjdk8-openj9:alpine-slim

RUN echo -e "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.13/main" > /etc/apk/repositories \
&& echo -e "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.13/community" >> /etc/apk/repositories

MAINTAINER Jackey.jiang

ARG PROFILES_ACTIVE
ARG JAR_FILE
ARG PROJECT_ARTIFACTID

#验证码字体包
RUN set -xe \
&& apk --no-cache add ttf-dejavu fontconfig


RUN mkdir -p /${project_artifactId}



ENV project_artifactId=${PROJECT_ARTIFACTID}
ENV profiles_active=${PROFILES_ACTIVE}
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /${project_artifactId}

EXPOSE 8500

ADD ${JAR_FILE} ./app.jar

ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
